<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>设置预警值</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="screen-orientation" content="portrait" />
    <link rel="stylesheet" href="/Resources/2.0/css/public.css">
    <script src="/Resources/2.0/js/size.js"></script>


</head>

<body >
    <div class="aim flexall" id="app">
        <div class="flex scroll-body">

            <div class="set-section-condition">
                <div class="set-section">
                    <div class="title-inner-wrap">
                        <div class="title-inner">
                            <span class="border"></span>
                            预警条件
                            <a href="javascript:;" class="del fr">
                                <span class="del-icon">×</span>
                                删除
                            </a>
                        </div>
                    </div>
                    <div class="list-section">
                        <div class="item">
                            <div class="item-inner">
                                <a href="javascript:;">
                                    <label for="">
                                        指标名称：
                                    </label>
                                    <div class="label-content">
                                        <i class="icon icon-user-go"></i>
                                    </div>
                                </a>
                            </div>
                        </div>
                        <div class="item">
                            <div class="item-inner flexall-hor">
                                <div class="label">
                                    值涨到：
                                </div>
                                <div class="flex label-supply">
                                    <input type="text">
                                </div>
                                <div class="label-content">
                                    元/吨
                                </div>
                            </div>
                        </div>
                        <div class="item">
                            <div class="item-inner flexall-hor">
                                <div class="label">
                                    值迭到：
                                </div>
                                <div class="flex label-supply">
                                    <input type="text">
                                </div>
                                <div class="label-content">
                                    元/吨
                                </div>
                            </div>
                        </div>
                        <div class="item">
                            <div class="item-inner flexall-hor">
                                <div class="label">
                                    涨幅超：
                                </div>
                                <div class="flex label-supply">
                                    <input type="text">
                                </div>
                                <div class="label-content">
                                    %
                                </div>
                            </div>
                        </div>
                        <div class="item">
                            <div class="item-inner flexall-hor">
                                <div class="label">
                                    跌幅超：
                                </div>
                                <div class="flex label-supply">
                                    <input type="text">
                                </div>
                                <div class="label-content">
                                    %
                                </div>
                            </div>
                        </div>
                        <div class="item item-btn">
                            <a href="javascript:;" class="add">
                                <i class="icon icon-plus"></i> 添加预警条件
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="set-section-result">
                <div class="set-section">
                    <div class="title-inner-wrap">
                        <div class="title-inner">
                            <span class="border"></span>
                            预警结果
                        </div>
                    </div>
                    <div class="list-section">
                        <div class="item">
                            <div class="item-inner">
                                <a href="javascript:;">
                                    <label for="">
                                        指标名称：
                                    </label>
                                    <div class="label-content">
                                        <i class="icon icon-user-go"></i>
                                    </div>
                                </a>
                            </div>
                        </div>
                        <div class="item item-aim-list">
                            <div class="item-inner">
                                <ul class="aim-list-item">
                                    <li class="active">涨价</li>
                                    <li class="">跌价</li>
                                    <li class="">需要关注</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <div class="aim-bottom-btn">
            <a href="javascript:;" class="btn-operate btn-active">
                确定
            </a>
        </div>

    </div>


    <script src="/Resources/2.0/js/zepto.js"></script>
    <script src="/Resources/2.0/js/mui.min.js"></script>
    <script src="/Resources/2.0/js/zepto.animate.basic.js"></script>
    <script src="/Resources/2.0/js/zepto.animate.js"></script>
    <script src="/Resources/2.0/js/public.js"></script>

    <script>
        // 添加
        Zepto('.set-section-condition').on('tap', '.add', function () {
            var aim=Zepto(this).closest('.set-section');
            var clone = aim.clone().css({
                'opacity': 0,
                'display': 'none'
            });
            aim.after(clone);
            clone.fadeIn()
            var _length=Zepto('.set-section-condition .set-section').length;
            if(_length>1){
                Zepto('.del').show()
            }else{
                Zepto('.del').hide()
            }
        })
        // 删除
        Zepto('.set-section-condition').on('tap', '.del', function () {
            var aim=Zepto(this).closest('.set-section');
            aim.remove();
            var _length=Zepto('.set-section-condition .set-section').length;
            if(_length>1){
                Zepto('.del').show()
            }else{
                Zepto('.del').hide()
            }
        })
        // 指标名称切换
        Zepto('.aim-list-item').on('tap', 'li', function () {
            Zepto(this).addClass('active').siblings('li').removeClass('active')
        })
    </script>


</body>

</html>